feat(evaluation): offline evaluation module with uv run evaluate CLI#280
Open
feat(evaluation): offline evaluation module with uv run evaluate CLI#280
Conversation
Implement src/evaluation/ — consumes saved agent trajectories
({run_id}.json under AGENT_TRAJECTORY_DIR) and scenario files, joins
them on scenario_id, runs a registered grader per scenario, and emits
a JSON report combining grading results with operational metrics
(tokens, duration p50/p95, tool calls, optional cost estimate).
The shape follows SWE-bench / HELM / τ-bench conventions: agent run
→ evaluate → report.json, with offline re-grading from saved
trajectories as a first-class workflow.
Includes:
- Pydantic models (Scenario, PersistedTrajectory, GradeResult,
OpsMetrics, EvalReport)
- Loader for trajectory dirs and JSON/JSONL scenario files
- Grader registry with two deterministic graders
(exact_string_match, numeric_match) and a pluggable LLM judge
bound to LLMBackend (six-criterion rubric)
- Per-task ops metric extraction (handles both SDK Trajectory and
plan-execute list[StepResult] shapes) plus aggregate rollups
- Report writer with terminal summary and JSON output
- evaluate script registered in [project.scripts]
- 39 unit tests covering models, loader, graders, metrics, report,
and end-to-end runner — all passing alongside existing 270 tests
Closes #279
Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
Collaborator
|
https://mlflow.org/docs/latest/genai/concepts/scorers/ Please use these concept and prefer to use Scorer
|
This was referenced Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/evaluation/module: load saved agent trajectories + scenarios → grade → emit JSON reportexact_string_match,numeric_match(deterministic), and a pluggable LLM judge with a six-criterion rubricuv run evaluateCLI registered inpyproject.tomlLayout follows the three-stage
run → evaluate → reportpattern used by SWE-bench, HELM, and τ-bench. Re-grading from saved trajectories is first-class — no need to re-run the agent.Closes #279
Test plan
uv run pytest src/evaluation/ -v— 39 passeduv run pytest src/ -v -k "not integration"— 309 passed (no regressions)uv run evaluate --trajectories <dir> --scenarios <file> --output report.json --grader-default exact_string_matchproduced the expected reportgrading_methodoverrides--grader-defaultTrajectorydict and plan-executelist[StepResult]shapes--judge-model litellm_proxy/anthropic/claude-opus-4-5against a real LiteLLM proxy on a small batch